﻿@model Site.Models.FinishedGamesDTO
@{
    ViewBag.Title = "Finished Games";
}
<html>
    <body>
        <h2>Finished games</h2>
        @{
                <ul>
                    @foreach (var game in Model.Games)
                    {
                        <li>
                            @String.Format("Id: {0} Players: {1} Duration: {2} minutes", game.Id, game.Players.Count, Model.GameDuration(game.Id))
                            <ul>
                                <li>Players:
                                    <ul>
                                        @foreach (var player in game.Players)
                                        {
                                            <li>
                                                @String.Format("{0} {1}", player.Name, Model.IsWinner(player) ? "WINNER" : "")
                                            </li>  
                                        }
                        
                                    </ul>
                                </li>
                    
                            </ul>
                        </li>
                    }
                </ul>
            <p> Return to @Html.ActionLink("Home", "Index", "Home")</p>
        }
    </body>

</html>